import { createApp } from "vue";
import App from "./App.vue";
import router from "./router";
import { createPinia } from "pinia";
import "./style/base.scss"; // 全局样式
import piniaPluginPersistedstate from "pinia-plugin-persistedstate";
import "element-plus/dist/index.css"; // element-plus样式
import * as ElementPlusIconsVue from "@element-plus/icons-vue"; // element-plus图标不生效
import * as directive from "./directive";
// import install from "./views/components";
const pinia = createPinia();
pinia.use(piniaPluginPersistedstate);
const app = createApp(App);
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component);
}

// 自定义指令
for (let i in directive) {
  app.directive(i, directive[i]);
}
// install(app);
app.use(pinia);
app.use(router);
app.mount("#app");
